﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Expressions;

namespace Upreader.Application.Model
{
    /// <summary>
    /// Specialized collection definition for models that allows updating and searching
    /// </summary>
    /// <typeparam name="TModel"></typeparam>
    public interface IModelCollection<TModel> : ICollection<TModel>
        where TModel: ModelBase
    {
        /// <summary>
        /// Marks the model specifed as updated 
        /// </summary>
        void Update(TModel model);

        /// <summary>
        /// Returns all models which satisfy the predicate
        /// </summary>
        IEnumerable<TModel> Find(Expression<Func<TModel, bool>> predicate);
    }
}
